<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1,user-scalable=no">
<title>报单管理</title>
<link rel="stylesheet" href="<?php echo $_BASE_DIR ?>baodan/css/common.css" >
<link rel="stylesheet" href="<?php echo $_BASE_DIR ?>baodan/css/key-management.css" >
</head>

<body>
<header class="header">
    <a class="back" href="javascript:history.back(-1)"></a>
	<div class="title">激活码管理</div>
</header>
<div style="height:40px;"></div>

<div class="menu-box">
	<ul class="menu clearfix">
		<li class="submenu" id="normal" style="width:50%"><p>未激活</p><p><?php echo count($unactive)?></p></li>
		<li class="submenu" id="abnormal" style="width:50%"><p>已激活</p><p><?php echo count($active)?></p></li>
	</ul>
</div>

<div class="goods-list25" id="normal_content">
	<ul class="key-list">
	<?php if(count($unactive)){
	       foreach ($unactive as $v){
	    ?>
		<li><p><?php echo $v['active_code']?></p><a href="/my/keysused?keyid=<?php echo $v['id']?>"><span >分配</span></a></li>
		<?php }
		}?>
	</ul>
</div>

<div class="goods-list25" id="abnormal_content">
	<ul class="dist-user-list">
		<?php if(count($active)){
	     foreach ($active as $v){
	    ?>
		<li>
			<div class="subitems1 clearfix"><p><?php echo $v['active_code']?></p><span>已激活</span></div>
			<div class="subitems2">
			   <p>激活用户：<?php echo $v['used_realname']?> </p>
			   <p>时间：<?php echo date('Y-m-d H:i:s',$v['usedtime'])?></p>
			</div>
		</li>
		<?php }
		}?>
	</ul>
	
</div>


<script type="text/javascript" src="<?php echo $_BASE_DIR ?>baodan/js/jquery-3.1.1.min.js"></script>
<script>
		

    $(function(){
        $(".submenu").click(function(){
            var _this = $(this);
            var _thisId = _this.attr('id');
            $(".submenu").removeClass('active');
            _this.addClass('active');
            $(".goods-list25").hide();
            $("#"+_thisId+"_content").show();
        })
    });
	var status = <?php echo $status ?>;
	if(status == 1){
		$("#abnormal").addClass("active");
		$("#abnormal_content").show();
		
	}else{
		$(".submenu:first").addClass("active");
		$(".goods-list25").hide().first().show();
	}

</script>
</body>
</html>
